//
//  WYExclusiveController.m
//  Boss
//
//  Created by admin on 2018/7/13.
//  Copyright © 2018年 admin. All rights reserved.
//

#import "WYExclusiveController.h"
#import "WYShareController.h"
@interface WYExclusiveController ()
@property (strong, nonatomic) IBOutlet UILabel *moneyLabel;
@property (strong, nonatomic) IBOutlet UIScrollView *scrollView;
@property (strong, nonatomic) IBOutlet UIView *mainView;
@property (strong, nonatomic) IBOutlet NSLayoutConstraint *top;

@end

@implementation WYExclusiveController

- (void)viewDidLoad {
    [super viewDidLoad];
    [self setupUI];
}
-(void)setupUI
{
    self.navigationItem.title = @"邀请BOSS";
    self.top.constant = self.navHeight;
    self.mainView.width = self.scrollView.width;
    self.mainView.height = 999;
    [self.scrollView addSubview:self.mainView];
    self.scrollView.contentSize = self.mainView.size;
    //self.moneyLabel.text = [NSString stringWithFormat:@"%.2f",self.money.floatValue/1000.0];
   
    
    NSMutableAttributedString *aString = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%.2f 元",self.money.floatValue/1000.0]];
    NSString *lenth = @"元";
    NSRange searchRange = NSMakeRange(0, aString.length);
    NSRange range = [aString.string rangeOfString:lenth options:kNilOptions range:searchRange];
    if (range.location == NSNotFound) return;
    
// [aString addAttribute:NSForegroundColorAttributeName value:[UIColor hexStringToColor:@"#d8593f" alpha:1.0] range:NSMakeRange(range.location, 1)];
    [aString addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:15]range:range];
    self.moneyLabel.attributedText = aString;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}
- (IBAction)inviteFriend:(id)sender {
    WYShareController *svc = [[WYShareController alloc]init];
    [self.navigationController pushViewController:svc animated:YES];
}
@end
